From: Florian Müllner Date: Fri, 3 Oct 2014 14:49:21 +0000 (+0200) Subject: screencast: Don't leak recorders on failure X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2053 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4ed4bb330e1814fcc5a403c094ffb755addb938f;p=gnome-shell.git screencast: Don't leak recorders on failure ShellRecorder.record() may fail, remove the recorder from the map in that case. https://bugzilla.gnome.org/show_bug.cgi?id=737846 --- diff --git a/js/ui/screencast.js b/js/ui/screencast.js index d1ccc5be7..def5dc9fa 100644 --- a/js/ui/screencast.js +++ b/js/ui/screencast.js @@ -117,6 +117,8 @@ const ScreencastService = new Lang.Class({ this._applyOptionalParameters(recorder, options); let [success, fileName] = recorder.record(); returnValue = [success, fileName ? fileName : '']; + if (!success) + this._stopRecordingForSender(sender); } invocation.return_value(GLib.Variant.new('(bs)', returnValue)); @@ -150,6 +152,8 @@ const ScreencastService = new Lang.Class({ this._applyOptionalParameters(recorder, options); let [success, fileName] = recorder.record(); returnValue = [success, fileName ? fileName : '']; + if (!success) + this._stopRecordingForSender(sender); } invocation.return_value(GLib.Variant.new('(bs)', returnValue));